CURRENT_MAKEFILE_PATH := $(realpath $(firstword ${MAKEFILE_LIST}))
CURRENT_PROJECT_PATH := $(shell dirname ${CURRENT_MAKEFILE_PATH})
CURRENT_PROJECT_TMP_DIR_PATH := ${CURRENT_PROJECT_PATH}/tmp


.PHONY: usage usage-list
usage: Makefile	## show usage
	@echo "====================="
	@echo "Current project path: ${CURRENT_PROJECT_PATH}"
	@echo "Makefile path: ${CURRENT_MAKEFILE_PATH}"
	@echo "====================="
	@make -s usage-list

usage-list: Makefile	## only show usage list
	@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' "${CURRENT_MAKEFILE_PATH}" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


.PHONY: clean
clean:	## clean useless data
	rm -rf "${CURRENT_PROJECT_TMP_DIR_PATH}"


